﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ResourceBlender.DAL {
    /// <summary>
    /// Configuration manager for the ResourceBlender DAL.
    /// </summary>
    public static class DalConfigurationManager {
        internal static DatabaseType DBMode { get; private set; }
        internal static string DBHost { get; private set; }
        internal static int DBPort { get; private set; }
        internal static string DBDatabase { get; private set; }
        internal static string TablePrefix { get; private set; }
        internal static string DBUser { get; private set; }
        internal static string DBPassword { get; private set; }
        internal static string DBPath { get; private set; }

        public static void Configure(IDataConfiguration dataConfiguration) {
            DBMode = dataConfiguration.DBMode;
            DBHost = dataConfiguration.DBHost;
            DBPort = dataConfiguration.DBPort;
            DBDatabase = dataConfiguration.DBDatabase;
            TablePrefix = dataConfiguration.TablePrefix;
            DBUser = dataConfiguration.DBUser;
            DBPassword = dataConfiguration.DBPassword;
            DBPath = dataConfiguration.DBPath;
        }
    }

    /// <summary>
    /// Contains database configuration data.
    /// </summary>
    public interface IDataConfiguration {
        DatabaseType DBMode { get; set; }
        string DBHost { get; set; }
        int DBPort { get; set; }
        string DBDatabase { get; set; }
        string TablePrefix { get; set; }
        string DBUser { get; set; }
        string DBPassword { get; set; }
        string DBPath { get; set; }
    }
}
